<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="button" value="点我" @click="change">
        <p v-if="isShow">中软睿达</p>
        <p v-show="isShow">中软睿达2</p>
        <p v-if="temp>40">热死我了</p>
    </div>
    <!-- 1.v-if指令的作用是：根据表达式的真假切换元素显示状态
    2.本质是通过操纵dom元素来切换显示状态
    3.表达式的值为true，元素存在于dom树中，为false 从dom中删除
    4.频繁的切换v-show，反之使用v-if，前者消耗小 -->
    <script>
        var app = new Vue({
            el:'#app',
            data:{
                isShow:true,
                temp:25
            },
            methods:{
                change:function(){
                    this.isShow = !this.isShow;
                }
            }
        })
    </script>
</body>
</html>